﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using WebComponents.Data;
using WebComponents;

public partial class Module_Contact : System.Web.UI.UserControl {
  protected void Page_Load(object sender, EventArgs e) {
    PageDescriptionInfo pageDesctiption = PageDescriptionController.GetByPageName("ThongTinCongTy", Global.CurrentCultureCode);
    if (pageDesctiption != null) {
      lblThongTinCongTy.Text = pageDesctiption.FullDescription;
    }
    pageDesctiption = PageDescriptionController.GetByPageName("ThongTinTaiKhoan", Global.CurrentCultureCode);
    if (pageDesctiption != null) {
      lblThongTinTaiKhoan.Text = pageDesctiption.FullDescription;
    }
  }
  protected void btnSend_Click(object sender, EventArgs e) {
    ContactInfo contact = new ContactInfo();
    contact.Name = txtHoTen.Text;
    contact.Address = txtAddress.Text;
    contact.Content = txtContent.Text;
    contact.CreatedDate = DateTime.Now;
    contact.Email = txtEmail.Text;
    contact.Status = 0;
    contact.Tel = txtSoDienThoai.Text;
    contact.Title = txtTitle.Text;
    contact.ChucVu = txtChucVu.Text;
    contact.Fax = txtFax.Text;
    contact.CompanyName = txtCompanyName.Text;
    ContactController.Insert(contact);
    formlienhe.Visible = false;
    lblMessage.Text = "Thông tin liên hệ đã gởi thành công! Cám ơn quý khách đã liên hệ  chúng tôi và hẹn gặp lại.";
  }
}
